#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>

int main()
{
  fprintf(stdout, "hello stdout\n");
  fprintf(stdout, "hello stdout\n");
  fprintf(stdout, "hello stdout\n");
  fprintf(stderr, "hello stderr\n");
  fprintf(stderr, "hello stderr\n");
  fprintf(stderr, "hello stderr\n");

  //int fd = open("log.txt", O_RDONLY);
  //dup2(fd, 0);
  //char buffer[1024];
  //read(0, buffer, sizeof(buffer));
  //printf("echo: %s", buffer);

 // close(1);
  //int fd = open("log.txt", O_WRONLY | O_CREAT | O_APPEND, 0666);
  //dup2(fd, 1);
  //const char* mesg = "hello linux\n";
  //write(1, mesg, strlen(mesg));
  //close(fd);

  return 0;
}
